let index = 0
class Node{
  id: number;
  dom:any;
  parent: Node | null;
  children:any[];
  props: any;
  level: number;
  forceUpdate:any;
  constructor(dom: any, props: any = {}, level?: number) {
    this.id = index++
    this.dom = dom
    this.parent = null
    this.children = []
    this.props = props
    this.level = level || 0
  }
  setParent(parent:Node) {
    this.parent = parent
    parent.children.push(this)
    this.level = parent.level+1
  }

}
export default Node